//
//  XMPPConfig.m
//  LTChat
//
//  Created by apple on 4/9/14.
//  Copyright (c) 2014 fantasy. All rights reserved.
//

#import "XMPPConfig.h"

static NSString *xmppJIDHost = @"xmpphost";
static NSString *xmppJIDPort = @"xmppport";

@implementation XMPPConfig

-(id)initWithConfigFile:(NSString *)file
{
    NSDictionary *config = [NSDictionary dictionaryWithContentsOfFile:file];
    NSAssert(config != nil, @"Please set XMPPConfig");
    return [self initWithHost:[config objectForKey:xmppJIDHost] port:[[config objectForKey:xmppJIDPort] unsignedShortValue]];
}
-(id)initWithHost:(NSString *)hostname port:(UInt16)port
{
    self = [super init];
    if (self) {
        _hostname = [hostname copy];
        _port = port;
    }
    return self;
}

@end
